#include<iostream>
using namespace std;
int gcd(int a, int b)
{
    while (b)
    {
        int t = b;
        b = a % b;
        a = t;
    }

    return a;
}

int main()
{
    int a, b;
    char c;
    cin >> a >> c >> b;
    int ret = gcd(a, b);
    cout << a / ret << '/' << b / ret << endl;
    return 0;
}